package com.adam.test.service.impl;

import com.adam.test.entity.User1;
import com.adam.test.mapper.User1Mapper;
import com.adam.test.service.PropagationSelectUser1Service;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author jiangwh
 */
@Service
public class PropagationSelectUser1ServiceImpl implements PropagationSelectUser1Service {
    
    @Resource
    private User1Mapper user1Mapper;

    @Override
    public User1 get(Integer id) {
        return user1Mapper.selectById(id);
    }

    @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
    @Override
    public User1 getRequired(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
    @Override
    public User1 getRequiresNew(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.NESTED, readOnly = true)
    @Override
    public User1 getNested(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
    @Override
    public User1 getSupports(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.MANDATORY, readOnly = true)
    @Override
    public User1 getMandatory(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    @Override
    public User1 getNotSupported(Integer id) {
        return get(id);
    }

    @Transactional(propagation = Propagation.NEVER, readOnly = true)
    @Override
    public User1 getNever(Integer id) {
        return get(id);
    }
    
}
